arr = [1, 3, [5, [7, 9, [11, 13]]], 15];


let flatten = (arr) => {
  return arr.reduce((pre, cur) => {
    return pre.concat(Array.isArray(cur) ? flatten(cur) : cur)
  }, [])
}

let result = flatten(arr);
console.log(result);